Learn R Programming

camtrapR (version 3.1.0)

[.records: Subsetting method for record tables

Description

Ensures the records class (and its attributes) is only retained when the columns they point to are still present after subsetting. This covers base R subsetting (x[...]), which does not go through dplyr's dplyr_reconstruct machinery.

Usage

# S3 method for records
[(x, i, j, ..., drop)

Arguments

x

an object used to select a method

i

row index

j

column index

...

further arguments passed to or from other methods

drop

logical, whether to simplify to a vector when selecting a single column